# -*- coding = utf-8 -*-
# @Time : 2022/2/16 15:10
# @File : laptop.py
# @Software : PyCharm

import time


class Laptop:
    __screen = ''
    __price = 0
    __cpu = ''
    __memory = ''
    __standby = 0

    def setScreen(self, screen):
        if screen == '':
            print('温馨提示：屏幕大小不能为空！')
        else:
            self.__screen = screen

    def getSreen(self):
        return self.__screen

    def setPrice(self, price):
        if price < 0 or price > 10000:
            print('温馨提示：价格数据非法！')
        else:
            self.__price = price

    def getPrice(self):
        return self.__price

    def setCpu(self, cpu):
        if cpu == '':
            print('温馨提示：CPU型号不能为空！')
        else:
            self.__cpu = cpu

    def getCpu(self):
        return self.__cpu

    def setMemory(self, memory):
        if memory == '':
            print('温馨提示：内存大小不能为空！')
        else:
            self.__memory = memory

    def getMemory(self):
        return self.__memory

    def setStandby(self, standby):
        if standby < 0 or standby > 10000:
            print('温馨提示：待机时长数据非法！')
        else:
            self.__standby = standby

    def getStandby(self):
        return self.__standby

    def type(self, type, hour):
        print('这个人已经', type, '打了', hour, '小时')

    def video(self, video, hour):
        print('这个人喜欢看', video, '，已经看了', hour, '小时')

    def games(self, game, hour):
        print('这个人喜欢玩', game, '，已经玩了', hour, '小时！', 'Loading', end='')
        for i in range(6):
            print("·", end="")
            time.sleep(1)
        print('游戏加载成功！')

    def showMe(self):
        print('这个电脑的屏幕大小是', self.__screen, '价格是', self.__price,
              'CPU型号是', self.__cpu, '内存大小是', self.__memory, '待机时长为', self.__standby)


computer = Laptop()
computer.setScreen('20英寸')
computer.setPrice(2999)
computer.setCpu('i9-12700')
computer.setMemory('32GB')
computer.setStandby(999)
computer.type('打字', 10)
computer.video('《妖神记》', 20)
computer.games('CS:GO', 24)
computer.showMe()
